<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
      <div id="app">
              <input type="text" v-model="orderName" placeholder="请输入商品名字">
          <input type="button" value="添加" @click="add()"></input>

          <button><a href="ShowOrder.html">查看所有订单</a></button>
      </div>
      <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
      <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>

        new Vue({
            el:'#app',
            data:{
                 orderName:''
            },
            methods:{
                  add:function () {
                      axios.post("http://127.0.0.1/api/addOrder",{"orderName":this.orderName}).then(
                          r=>{
                              alert(r.data);
                          }
                      )
                  }
            }
        });
    </script>

</body>
</html>